//
//  LLTPhotoModel.swift
//  mmda
//
//  Created by 李陆涛 on 2018/8/14.
//  Copyright © 2018年 mmda. All rights reserved.
//

import UIKit
import Photos

enum ImageType {
    case photo
    case video
}


class LLTPhotoModel: NSObject {

    var imageType:ImageType?
    var url:URL?
    var image:UIImage?
    
    var asset:PHAsset?
    
    
    class func model(type:ImageType,url:URL?,image:UIImage?) -> LLTPhotoModel {
        
        
        let model = LLTPhotoModel()
        model.imageType = type
        model.url = url
        model.image = image
        
        return model
        
    }
    
    class func model(asset:PHAsset?,image:UIImage?) -> LLTPhotoModel {
        
        
        let model = LLTPhotoModel()
        model.imageType = asset?.mediaType == .video ? .video : .photo
        model.asset = asset
        model.image = image
        
        return model
        
    }
    
}
